<script type="text/javascript">
$(function() {
  $( "#truck_condition_from_date" ).datepicker({dateFormat: "dd-mm-yy"});
  $( "#truck_condition_through_date" ).datepicker({dateFormat: "dd-mm-yy"});
});
</script>
<div class="container-fluid">
  <%= form_for [@truck, @truck_condition], :html => { :class => 'form-horizontal' } do |f| %>
  <legend><%= controller.action_name.capitalize %> condition for <%=@truck.name%></legend>
  <div class="row-fluid">
    <div class="span12">
      <div class="row-fluid">
        <div class="span6">
          <label>Condition type</label>
          <%= f.select :truck_condition_type_id, options_from_collection_for_select(TruckConditionType.all, :id, :name), {}, :class => 'span12' %>
        </div>
        <div class="span6">
          <label>Remarks</label>
          <%= f.text_area :remarks, :rows => '3', :style => "width: 400px;"  %>
        </div>
      </div>  
      <div class="row-fluid">
        <div class="span6">
          <label>From date</label>
          <%= f.text_field :from_date, :class => 'span12' %>
        </div>
        <div class="span6">
          <label>Through date</label>
          <%= f.text_field :through_date, :class => 'span12' %>
        </div>
      </div>          
    </div>
  </div>
  <div class="form-actions">
    <%= f.submit 'Add condition', :class => 'btn btn-primary' %>
    <%= link_to 'Cancel', trucks_path, :class => 'btn' %>
  </div>
  <!--/row-->
  <% end %>
</div>
<!--/.fluid-container-->
